from fastcrc import crc64


def get_crc64(filename: str):
    """
    计算文件的CRC64签名。与COS核对，确保文件一致性。
    """
    out = 0

    with open(filename, 'rb') as f:
        while True:
            data = f.read(4096)
            if not data:
                break

            out = crc64.xz(data, initial=out)
    return out
